package o;

import android.content.Context;
import android.content.Intent;
import android.text.TextUtils;
import androidx.annotation.NonNull;
import com.huawei.appgallery.foundation.application.pkgmanage.model.update.ApkUpgradeInfo;
import com.huawei.appgallery.updatemanager.impl.badge.dao.BadgeAppIcon;
import com.huawei.appgallery.updatemanager.impl.fileinfo.dao.AppFileInfo;
import com.huawei.appgallery.updatemanager.impl.ignore.dao.IgnoreInfo;
import com.huawei.appgallery.updatemanager.impl.keysets.dao.AppKeySets;
import com.huawei.appgallery.updatemanager.impl.updateinfo.dao.NotRecoUpgradeInfo;
import com.huawei.hmf.annotation.ApiDefine;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

@ApiDefine(uri = czs.class)
public class dah implements czs {
    public void ॱ(Context context) {
        ((czu) dbn.ˎ(czu.class)).ॱ(dan.ˏ().ˋ(), false);
    }

    public void ˎ(Context context) {
        ˊ(context);
    }

    private void ˊ(Context context) {
        Set<String> ॱ = new dax(context).ॱ("last_received_update_time_timemillis", new HashSet(0));
        Map hashMap = new HashMap();
        for (String str : ॱ) {
            if (!TextUtils.isEmpty(str)) {
                String[] split = str.split("###");
                if (split.length == 2) {
                    CharSequence charSequence = split[0];
                    if (!TextUtils.isEmpty(charSequence)) {
                        try {
                            hashMap.put(charSequence, Long.valueOf(Long.parseLong(split[1])));
                        } catch (NumberFormatException e) {
                            Logger.ˏ("UpdateInitDataImpl", "time error");
                        }
                    }
                }
            }
        }
        ((czu) dbn.ˎ(czu.class)).ˎ(hashMap);
    }

    public void ˋ(Context context) {
        czu o_czu = (czu) dbn.ˎ(czu.class);
        o_czu.ˏ(context, ˋ(o_czu, daw.ॱ()), false);
    }

    public void ˏ(Context context) {
        czu o_czu = (czu) dbn.ˎ(czu.class);
        o_czu.ˊ(ˋ(o_czu, dav.ॱ()), false);
        ll.ˏ(context).ˋ(new Intent("refresh.update.fragment.broadcast"));
    }

    @NonNull
    private List<ApkUpgradeInfo> ˋ(czu o_czu, cfs o_cfs) {
        List<ApkUpgradeInfo> ˎ = o_cfs.ˎ();
        List<ApkUpgradeInfo> arrayList = new ArrayList();
        for (ApkUpgradeInfo ˎ2 : ˎ) {
            ApkUpgradeInfo ˎ22 = o_czu.ˎ(ˎ22);
            if (ˎ22 != null) {
                arrayList.add(ˎ22);
            }
        }
        return arrayList;
    }

    @NonNull
    public List<? extends cfr> ˏ() {
        List<? extends cfr> arrayList = new ArrayList();
        arrayList.add(new AppFileInfo());
        arrayList.add(new NotRecoUpgradeInfo());
        arrayList.add(new AppKeySets());
        arrayList.add(new IgnoreInfo());
        arrayList.add(new BadgeAppIcon());
        return arrayList;
    }
}
